<template>
  <div class="home">
    <div class="carousel">
      <el-carousel :interval="3000" type="card" height="300px" indicator-position="outside">
        <el-carousel-item v-for="item in ticketCarousel.items" :key="item" :label="item">
          <h3 class="medium"></h3>
        </el-carousel-item>
      </el-carousel>
    </div>

    <airplane-list v-on:make-order="onMakeOrder"></airplane-list>
  </div>
</template>
<script>
import AirplaneList from "../components/AirplaneList.vue";
export default {
  data() {
    return {
      activeIndex: "1",
      ticketCarousel:{
        items:['桂林','北京','上海','大理']
      }
    };
  },
  methods: {
    handleSelect(key, keyPath) {
      console.log(key, keyPath);
    },
    onMakeOrder(info) {
      console.log(info);
      this.$router.push("/Order/" + encodeURIComponent(JSON.stringify(info)));
    }
  },
  components: {
    AirplaneList
  }
};
</script>
<style>
.please-login,
.please-register {
  text-decoration-line: none;
}
.home{
  background-image:url(../assets/home-background.jpg);
  width: 100%;
	background-size: cover; /* 使图片平铺满整个浏览器（从宽和高的最大需求方面来满足，会使某些部分无法显示在区域中） */
	background-repeat: no-repeat;
}
.el-carousel__item h3 {
  color: #475669;
  font-size: 14px;
  opacity: 0.75;
  line-height: 200px;
  margin: 0;
}
.el-carousel__item:nth-child(4n) {
  background-color: #99a9bf;
  background-image:url(../assets/beijing.jpg);
  background-size: cover;
  background-position:center;
}
.el-carousel__item:nth-child(4n + 1) {
  background-color: #d3dce6;
  background-image:url(../assets/shanghai.jpg);
  background-size: cover;
  background-position:center;
}
.el-carousel__item:nth-child(4n + 2) {
  background-color: #d3dce6;
  background-image:url(../assets/dali.jpg);
  background-size: cover;
  background-position:center;
}
.el-carousel__item:nth-child(4n + 3) {
  background-color: #d3dce6;
  background-image:url(../assets/guilin.jpg);
  background-size: cover;
  background-position:center;
}
.el-carousel__button{
    background-color: white !important;
    color: black !important;
    font-weight: bold !important;
}
.carousel{
  padding: 20px;
}
</style>